{% extends 'stark/layout.html' %}

{% block body %}
    <h1>单条录入</h1>
    <form method="post" class="form-horizontal" novalidate>
        {% csrf_token %}
        {% for field in form %}
            <div class="col-sm-6">
                <div class="form-group" style="margin-bottom: 20px;">
                    <label for="inputEmail3" class="col-sm-2 control-label">{{ field.label }}</label>
                    <div class="col-sm-10" style="position: relative">
                        <!-- 判断，如果field是ModelChoiceField，则FK； 如果是ModelMultipleChoiceField，则M2M -->
                        {{ field }}

                        <div style="position: absolute;font-size: 12px;left: 15px; right: 15px;color: #e4393c;background: #FFEBEB;">{{ field.errors.0 }}</div>
                    </div>
                </div>
            </div>
        {% endfor %}
        <div class="col-sm-offset-11 col-sm-1">
            <input type="submit" class="btn btn-primary" value="提交">
    </div>
    </form>
{% endblock %}